package com.example.slotmachine;



import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Spinner;

public class MainActivity extends Activity {

	//variables
	
	//Row 1
	Spinner spinner1R1;
	Spinner spinner2R1;
	Spinner spinner3R1;
	EditText row1Bet_editText;
	//Row 2
	Spinner spinner1R2;
	Spinner spinner2R2;
	Spinner spinner3R2;
	EditText row2Bet_editText;
	//Row 3
	Spinner spinner1R3;
	Spinner spinner2R3;
	Spinner spinner3R3;
	EditText row3Bet_editText;
	
	//Final Buttons
	Button roll_button;
	Button collect_button;
	EditText moneyToCollect_editText;
	
	
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        
        //Row 1
        spinner1R1 = (Spinner) findViewById(R.id.spinner1R1);
        spinner2R1 = (Spinner) findViewById(R.id.spinner2R1);
        spinner3R1 = (Spinner) findViewById(R.id.spinner3R1);
        row1Bet_editText = (EditText) findViewById(R.id.row1Bet_editText);
        
        //Row 2
        spinner1R2 = (Spinner) findViewById(R.id.spinner1R2);
        spinner2R2 = (Spinner) findViewById(R.id.spinner2R2);
        spinner3R2 = (Spinner) findViewById(R.id.spinner3R2);
        row2Bet_editText = (EditText) findViewById(R.id.row2Bet_editText);
        
        //Row 3
        spinner1R3 = (Spinner) findViewById(R.id.spinner1R3);
        spinner2R3 = (Spinner) findViewById(R.id.spinner2R3);
        spinner3R3 = (Spinner) findViewById(R.id.spinner3R3);
        row3Bet_editText = (EditText) findViewById(R.id.row3Bet_editText);
        
        //Final Buttons
        roll_button = (Button) findViewById(R.id.roll_button);
        collect_button = (Button) findViewById(R.id.collect_button);
        moneyToCollect_editText = (EditText) findViewById(R.id.moneyToCollect_textView);
        
        
        //Configuring Slot Values
        
/////////////////////R1
        
        //Spinner 1R1
        ArrayAdapter spinner1R1adapter= ArrayAdapter.createFromResource(this, R.array.slotValues, android.R.layout.simple_spinner_item);
        spinner1R1adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
        spinner1R1.setAdapter(spinner1R1adapter);
        spinner1R1.setClickable(false);

        
        //Spinner 2R1
        ArrayAdapter spinner2R1adapter= ArrayAdapter.createFromResource(this, R.array.slotValues, android.R.layout.simple_spinner_item);
        spinner2R1adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
        spinner2R1.setAdapter(spinner2R1adapter);
        spinner2R1.setClickable(false);
        
        //Spinner 3R1
        ArrayAdapter spinner3R1adapter= ArrayAdapter.createFromResource(this, R.array.slotValues, android.R.layout.simple_spinner_item);
        spinner3R1adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
        spinner3R1.setAdapter(spinner1R1adapter);
        spinner3R1.setClickable(false);
        
/////////////////////R2
        
        //Spinner 1R2
        ArrayAdapter spinner1R2adapter= ArrayAdapter.createFromResource(this, R.array.slotValues, android.R.layout.simple_spinner_item);
        spinner1R2adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
        spinner1R2.setAdapter(spinner1R2adapter);
        spinner1R2.setClickable(false);
        
        //Spinner 2R2
        ArrayAdapter spinner2R2adapter= ArrayAdapter.createFromResource(this, R.array.slotValues, android.R.layout.simple_spinner_item);
        spinner2R2adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
        spinner2R2.setAdapter(spinner2R2adapter);
        spinner2R2.setClickable(false);
        
        //Spinner 3R2
        ArrayAdapter spinner3R2adapter= ArrayAdapter.createFromResource(this, R.array.slotValues, android.R.layout.simple_spinner_item);
        spinner3R2adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
        spinner3R2.setAdapter(spinner1R2adapter);
        spinner3R2.setClickable(false);
        
/////////////////////R3
		        
		//Spinner 1R3
		ArrayAdapter spinner1R3adapter= ArrayAdapter.createFromResource(this, R.array.slotValues, android.R.layout.simple_spinner_item);
		spinner1R3adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
		spinner1R3.setAdapter(spinner1R3adapter);
		spinner1R3.setClickable(false);
		
		//Spinner 2R3
		ArrayAdapter spinner2R3adapter= ArrayAdapter.createFromResource(this, R.array.slotValues, android.R.layout.simple_spinner_item);
		spinner2R3adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
		spinner2R3.setAdapter(spinner2R3adapter);
		spinner2R3.setClickable(false);
		
		//Spinner 3R3
		ArrayAdapter spinner3R3adapter= ArrayAdapter.createFromResource(this, R.array.slotValues, android.R.layout.simple_spinner_item);
		spinner3R3adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
		spinner3R3.setAdapter(spinner1R3adapter);
		spinner3R3.setClickable(false);
		
/////////////////////Editable text uneditable
		
		moneyToCollect_editText.setEnabled(false);

		
        
    }


    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }
    
}
